#include <iostream>
#include <vector>
using namespace std;

int main() {
    int level = 0; cin >> level;
    if(level <= 0) return -1;

    vector<int> curlevel(level, 0);
    for(int i = 0; i < level; ++i){
        for(int j = i; j >= 0; --j){
            if(j == 0 || j == i) curlevel[j] = 1;
            else {
                curlevel[j] = curlevel[j - 1] + curlevel[j];
            }
        }
        for(int j = 0; j <= i; ++j){
            printf("%5d", curlevel[j]);
        }
        std::cout << "\n";
    }
    return 0;
}
// 64 位输出请用 printf("%lld")

/*
    for(int i = 1; i <= level; ++i){
        for(int j = 1; j <= i; ++j){
            if(j == i) curlevel.push_back(1);//curlevel动态扩容，需要在判断j==1前
            else if(j == 1) curlevel[j] = 1;
            else{
                // j -> 2 ~ i - 1
                curlevel[j] = curlevel[j - 1] + curlevel[j];
            }
        }
        for(int j = 1; j <= i; ++j){
            std::cout << curlevel[j] << " ";
        }
        std::cout << "\n";
    }
*/